
package DBLayer;
import ModelLayer.Task;
import ModelLayer.PartOrder;
import java.util.ArrayList;

/**
 * @version 12/22/2011
 * @author Gruppe 4
 */

public interface IFDBTask {
    
    /**
     * Method to find all tasks from the database
     * @param ()
     * @return Returns an ArrayList<Task>
     */
    public ArrayList<Task> getAllTasks(boolean retrieveAssociation);
    
    /**
     * Method to find all tasks from the database by orderId
     * @param orderId int 
     * @param retreiveAssociation boolean
     * @return Returns an ArrayList<Task>
     */
    public ArrayList<Task> findTasksByOrderId(int orderId, boolean retrieveAssociation);
    
    /**
     * Method to find all tasks from the database by orderId
     * @param taskId int
     * @param retreiveAssociation boolean
     * @return Returns an ArrayList<PartOrder>
     */
    public ArrayList<PartOrder> findPartOrdersByTaskId(int taskId, boolean retrieveAssociation);
    
    /**
     * Method to find a Task object in the database
     * @param taskId int taskId the taskId of the task
     * @param retreiveAssociation boolean
     * @return returns an Object of type Task
     */
    public Task findTask(int taskId, boolean retrieveAssociation);
    
    /**
     * Method to find a Task object in the database
     * @param taskId int taskId the taskId of the Task
     * @param retreiveAssociation boolean
     * @return returns an Object of type Task
     */
    public Task searchTaskId(int taskId, boolean retrieveAssociation);
    
    /**
     * Method to find a Task object in the database by date
     * @param startDate String startDate the startDate of the Task
     * @param retreiveAssociation boolean
     * @return returns an Object of type Task
     */
    public Task searchTaskDate(String startDate, boolean retrieveAssociation);
    
    /**
     * Method to insert a Task object into the database
     * @param taskObj an Object of the type Task
     * @param orderId int
     * @return returns an int 1 if the method succedes and -1 if the method fails
     */
    public int insertTask(Task taskObj, int orderId) throws Exception;
    
    /**
     * Method to insert a PartOrder object into the database
     * @param partOrder an Object of the type PartOrder
     * @return returns an int 1 if the method succedes and -1 if the method fails
     */
    public int insertPartOrder(PartOrder partOrder) throws Exception;
    
    /**
     * Method to update a Task in the database;
     * @param task an Object of the type Task
     * @return returns an int 1 if the method succedes and -1 if the method fails
     */
    public int updateTask(Task task);
    
    /**
     * Method to delete a Task from the database
     * @param taskId int taskId the id of the Task
     * @return returns an int 1 if the method succedes and -1 if the method fails
     */
    public int deleteTask(int taskId);     
}